<template>
	<view>
		购物车
		<view v-if="goods_lists&&goods_lists.shoppingCartItemList">
		<view v-for="item in goods_lists.shoppingCartItemList" :key="item.shoppingcartId">
			<image :src="item.skuImage" style="width:200px;height:200px;"></image>
			<view>{{item.productName}}</view>
		</view>
			<view>总价2：{{goods_lists.totalPrice/100}}</view>
		</view>
		<navigator url="../order/create">去结算</navigator>
	</view>
</template>
<script setup>
	import {onShow} from '@dcloudio/uni-app'
	import {ref} from 'vue'
	import {getCart,getOpenid,getPayParams,getOrderInfo,getId} from '@/api/index.js'
	// 定义购物车数据
	const goods_lists = ref([]);
	onShow(()=>{
		getCart()
		.then(res=>{
			// 更新购物车数据
			goods_lists.value = res.data.goods_lists;
		})
	})
	
	 
 
</script>